
/*
 * @Description: 系统配置 - 接口
 * @Author: DSY
 * @Date: 2022-03-14 22:28:33
 * @LastEditors: DSY
 * @LastEditTime: 2022-03-14 22:28:33
 */

import { $get, $post, $put } from '/@/utils/http'
import { ContentTypeEnum } from '/@/constant/http'
import {
  SysconfigModel,
  SysconfigPageParams,
  SysconfigPageResultModel,
  SysconfigResultModel
} from './model/sysconfigModel'

/**
 * 分页查询
 */
export const apiSysconfigSearch = (searchParams: SysconfigPageParams) =>
  $get<SysconfigPageResultModel>({
    url: '/sys/twbSysconfig/search',
    params: searchParams
  })

/**
 * 根据ID获取详情
 */
export const apiSysconfigGetById = (id: string) =>
  $get<SysconfigResultModel>({
    url: '/sys/twbSysconfig/getById',
    params: { id: id }
  })

/**
 * 保存信息
 */
export const apiSysconfigSave = (saveParams: SysconfigModel) =>
  $post<SysconfigResultModel>({
    url: '/sys/twbSysconfig/save',
    contentType: ContentTypeEnum.json,
    params: saveParams
  })

/**
 * 更新信息
 */
export const apiSysconfigUpdateById = (updateParams: SysconfigModel) =>
  $put<SysconfigResultModel>({
    url: '/sys/twbSysconfig/updateById',
    contentType: ContentTypeEnum.json,
    params: updateParams
  })

/**
 * 根据ID删除信息
 */
export const apiSysconfigDeleteById = (id: string) =>
  $post<SysconfigResultModel>({
    url: '/sys/twbSysconfig/delete',
    params: { id: id }
  })

/**
 * 批量删除信息
 */
export const apiSysconfigBatchDeleteByIds = (ids: string) =>
  $post<SysconfigResultModel>({
    url: '/sys/twbSysconfig/batchDeleteByIds',
    params: { ids: ids }
  })

/**
 * 根据ID逻辑删除信息
 */
export const apiSysconfigLogicDeleteById = (id: string) =>
  $post<SysconfigResultModel>({
    url: '/sys/twbSysconfig/logicDeleteById',
    params: { id: id }
  })

/**
 * 批量逻辑删除
 */
export const apiSysconfigLogicBatchDeleteByIds = (ids: string) =>
  $post<SysconfigResultModel>({
    url: '/sys/twbSysconfig/logicBatchDeleteByIds',
    params: { ids: ids }
  })
